﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="PowerCommand.aspx.cs" Inherits="Command_PowerCommand" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>正贸仓储物流管理系统</title>
    <link href="../css/css.css" rel="stylesheet" type="text/css" />
    <script src="../../js/Validate.js"></script>
    <script type="text/javascript" src="../../JS/jquery-1.10.2.js"></script>
    <script type="text/javascript" language="javascript">
    
        function SelectAllCheckBox() {
            var form = document.forms[0];
            for (i = 0; i < form.elements.length; i++) {
                if (form.elements[i].checked == false) {
                    j = 0;
                }
                else {
                    j = 1;
                }
            } if (j == 0) {
                for (i = 0; i < form.elements.length; i++) {
                    form.elements[i].checked = true;
                }
            }
            else {
                for (i = 0; i < form.elements.length; i++) {
                    form.elements[i].checked = false;
                }
            }
        }
       
        function OpenTrayPosAdd() {

            document.getElementById('<%=hidden.ClientID %>').value = window.showModalDialog("TrayPosAdd.aspx", window, "dialogWidth=600px;dialogHeight=234px;scroll:no;resizable:no;status:0;");
            document.URL = location.href;
        }

        function checkSel(){
            if( $('#gv input[type=checkbox]:checked').length <= 0){
                alert("请勾选数据!");
                return false;
            }
        }
    </script>

</head>
<body>
    <form id="form1" runat="server">
        <div>
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr>
                    <td style="height: 30px">
                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
                            <tr>
                                <td style="background-image: url(../images/tab_03.gif); background-repeat: repeat-x; width: 12px;">&nbsp;
                                </td>
                                <td style="background-image: url(../images/tab_05.gif); background-repeat: repeat-x; height: 30px;">
                                    <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                        <tr>
                                            <td style="width: 46%; vertical-align: middle;">
                                                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                                    <tr>
                                                        <td style="width: 5%; vertical-align: middle;">
                                                            <img src="../images/tb.gif" width="16" height="16" />
                                                        </td>
                                                        <td style="width: 95%;">
                                                            <span>你当前的位置</span>：业务管理-指令列表
                                                        </td>
                                                    </tr>
                                                </table>
                                            </td>
                                            <td width="54%"></td>
                                        </tr>
                                    </table>
                                </td>
                                <td width="16" style="background-image: url(../images/tab_07.gif); height: 30px;">&nbsp;
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr>
                    <td>
                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
                            <tr>
                                <td style="background-image: url(../images/tab_12.gif); width: 8px;">&nbsp;
                                </td>
                                <td>
                                    <table width="100%" border="0" cellspacing="0" cellpadding="0" style="border: 1px solid #b5d6e6;">
                                        <tr>
                                            <td style="padding: 2px;">
                                                <table width="100%" cellspacing="0" cellpadding="0" border="0" style="border: 1px solid #b5d6e6;">
                                                    <tr>
                                                        <td colspan="6" align="left" style="padding-left: 4px; padding-top: 2px;">
                                                            <span style="color: Red;">&nbsp;<asp:Label ID="labErrMsg" runat="server"></asp:Label></span>
                                                        </td>
                                                        <td align="right" style="padding-right: 4px; width: 40%; padding-top: 2px;">
                                                            <asp:ImageButton ID="ibtnReset" runat="server" ImageUrl="~/Images/btn/btn_re.gif"
                                                                OnClick="ibtnReset_Click" />
                                                            <asp:ImageButton ID="ibtnPower" runat="server" ImageUrl="~/Images/btn/btn_guozhang.gif"
                                                                OnClick="ibtnPower_Click" OnClientClick="checkSel()" />
                                                            <asp:ImageButton ID="ibtnCanCommand" runat="server" ImageUrl="~/Images/btn/btn_CancelCommand.gif"
                                                                OnClick="ibtnCanCommand_Click" OnClientClick="checkSel()" />
                                                            <asp:ImageButton ID="ibtnALLout" Visible="false" runat="server" ImageUrl="~/Images/btn/btn_AOut.gif"
                                                                OnClick="ibtnALLout_Click" />
                                                            <asp:ImageButton ID="ibtnTrayPosMan" Visible="false" runat="server" ImageUrl="~/Images/btn/btn_TrayPosMan.gif"
                                                                OnClientClick="OpenTrayPosAdd()" />
                                                        </td>
                                                    </tr>
                                                </table>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td style="padding: 2px">
                                                <div style="margin-left: 0px; margin-top: 3px; width: 100%; height: 560px; overflow-x: auto; overflow-y: auto;">
                                                    <asp:GridView ID="gv" runat="server" AutoGenerateColumns="False" Width="100%" BorderWidth="1px"
                                                        BorderColor="#B5D6E6" CellPadding="0" OnRowDataBound="gv_RowDataBound">
                                                        <Columns>
                                                            <asp:TemplateField>
                                                                <HeaderTemplate>
                                                                    <input id="hchkSelect" type="checkbox" onclick="SelectAllCheckBox()" />
                                                                </HeaderTemplate>
                                                                <ItemTemplate>
                                                                    <asp:CheckBox ID="chkSelect" runat="server" />
                                                                </ItemTemplate>
                                                                <ItemStyle Width="5%" />
                                                            </asp:TemplateField>
                                                            <asp:TemplateField HeaderText="序号">
                                                                <ItemTemplate>
                                                                    <asp:Label ID="LabNumber" runat="server" Text="<%#Container.DataItemIndex+1%>"></asp:Label>
                                                                </ItemTemplate>
                                                                <ItemStyle Width="5%" />
                                                            </asp:TemplateField>
                                                            <asp:BoundField DataField="TaskID" HeaderText="任务号"></asp:BoundField>
                                                            <asp:BoundField DataField="Tray_ID" HeaderText="托盘号"></asp:BoundField>
                                                            <asp:BoundField DataField="TaskMode" HeaderText="作业方式"></asp:BoundField>
                                                            <asp:BoundField DataField="SyncWcs" HeaderText="同步WCS"></asp:BoundField>
                                                            <asp:BoundField DataField="PosS_ID" HeaderText="起点货位号"></asp:BoundField>
                                                            <asp:BoundField DataField="PosE_ID" HeaderText="终点货位号"></asp:BoundField>
                                                            <asp:BoundField DataField="EquipmentS_ID" HeaderText="起点设备号"></asp:BoundField>
                                                            <asp:BoundField DataField="EquipmentE_ID" HeaderText="终点设备号"></asp:BoundField>
                                                            <asp:BoundField DataField="TaskStatus" HeaderText="指令状态"></asp:BoundField>
                                                            <asp:BoundField DataField="CDT" HeaderText="创建时间"></asp:BoundField>
                                                        </Columns>
                                                        <HeaderStyle HorizontalAlign="Center" CssClass="gvHeader" />
                                                        <RowStyle CssClass="gvRow" HorizontalAlign="Center" />
                                                    </asp:GridView>
                                                </div>
                                            </td>
                                        </tr>
                                    </table>
                                </td>
                                <td style="background-image: url(../images/tab_15.gif); width: 8px;">&nbsp;
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr>
                    <td style="background-image: url(../images/tab_19.gif); height: 35px;">
                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
                            <tr>
                                <td style="width: 12px; height: 35px;">
                                    <img src="../images/tab_18.gif" width="12" height="35" />
                                </td>
                                <td>&nbsp;
                                </td>
                                <td width="16">
                                    <img src="../images/tab_20.gif" width="16" height="35" />
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
            </table>
            <asp:HiddenField ID="hidden" runat="server" />
        </div>
    </form>
</body>
</html>
